home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / poc.mail.local.txt < prev    next >
Encoding:
Text File  |  1999-03-24  |  2.3 KB  |  68 lines

  1. Proof of Concept - Security Advisory                        02/15/99
  2. http://poc.csoft.net                                     Released by
  3. poc@csoft.net                                    sw3wn@poc.csoft.net
  4.  
  5. ---
  6.  
  7. Affected Program        mail.local (Berkeley Sendmail)
  8. Description             Local mailer (forward mail to mailboxes)
  9. Severity                Mailbox compromise
  10.  
  11.  
  12. Synopsis:
  13.  
  14. mail.local is a small program distributed with Berkeley Sendmail,
  15. used as a local mailer (forwards mail to mailboxes), also able to
  16. handle LMTP commands.  It runs SUID root in order to access the
  17. users's mailbox (ie. /var/spool/mail, /usr/spool/mail).
  18.  
  19. Overview:
  20.  
  21. When mail has to be written to a user's mailbox locally, a local
  22. mailer is used; the mail.local program that comes with Sendmail
  23. does this task, but does not restrict the length of a message, or
  24. does not check the authenticity of the user who sends it.
  25.  
  26. This is obviously not a big security issue - but still, it has to
  27. get fixed, as this could lead to more serious problem if used
  28. on a system with lots of e-mail accounts.
  29.  
  30. Problem:
  31.  
  32. This can lead to the compromising of anybody's mailbox - from fake
  33. (and totally untraceable messages), to flooding the mailbox (and
  34. maybe the hard drive).  I found this by inspecting the source code for
  35. buffer overflows heh.
  36.  
  37. Say I wanted to send a fake message like it was coming from root
  38. to user joe, simply running
  39.    mail.local -f root joe
  40.    <message+eof>
  41. could do it.  mail.local simply dumps the message as you enter
  42. it in the user's maibox.
  43.  
  44. Since mail.local does not checks for message length, you can
  45. flood a mailbox (and possibly the hard drive) in a matter of seconds.
  46.  
  47. Finally, mail.local only check if a user exists by using /etc/passwd,
  48. that means anybody could create mailboxes for users like bin, nobody,
  49. etc (usually it's no security compromise).
  50.  
  51. Examples:
  52.  [http://poc.csoft.net/advs/mail.local/mailfrm.tar.gz]
  53.  [http://poc.csoft.net/advs/mail.local/junk.tar.gz]
  54.  
  55. Patch/Fix:
  56.  [http://poc.csoft.net/advs/mail.local/mail.local.diff]
  57.  
  58. Status:
  59.  
  60. I contacted the authors about this, since this is not a big security
  61. concern for most people it's not a hurry =p.  I made a quick-and-dirty
  62. patch that logs attempt to send messages bigger than X to syslog (you
  63. really should adapt it to your system if you want to use it).
  64. I really had nothing to do today.
  65.  
  66. .sw3
  67.  
  68.